From: Michael Albinus Date: Sun, 29 Nov 2009 20:40:12 +0000 (+0000) Subject: * tramp.texi (Remote processes): Improve eshell example with "su" X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~9187 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=7dc4463b2876c35419c5c1b9f59514d26e6fba4a;p=emacs.git * tramp.texi (Remote processes): Improve eshell example with "su" and "sudo" commands. --- diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 2c48fe32c55..f0c0b6a3924 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2584,6 +2584,27 @@ uid=0(root) gid=0(root) groups=0(root) @b{@trampfn{sudo, root, host, /etc} $} @end example +@ifset emacs +Since @value{emacsname} 23.2, @code{eshell} has also an own +implementation of the @code{su} and @code{sudo} commands. Both +commands change the default directory of the @file{*eshell*} buffer to +the value related to the user the command has switched to. This works +even on remote hosts, adding silently a corresponding entry to the +variable @code{tramp-default-proxies-alist} (@pxref{Multi-hops}): + +@example +@b{~ $} cd @trampfn{ssh, user, remotehost, /etc} @key{RET} +@b{@trampfn{ssh, user, remotehost, /etc} $} find-file shadow +File is not readable: @trampfn{ssh, user, remotehost, /etc/shadow} +@b{@trampfn{ssh, user, remotehost, /etc} $} sudo find-file shadow +# +@b{@trampfn{ssh, user, remotehost, /etc} $} su - @key{RET} +@b{@trampfn{su, root, remotehost, /root} $} id @key{RET} +uid=0(root) gid=0(root) groups=0(root) +@b{@trampfn{su, root, remotehost, /root} $} +@end example +@end ifset + @anchor{Running a debugger on a remote host} @subsection Running a debugger on a remote host